package 算法语言基础.Day11_9;

/**
 * @projectName: JAVA编程
 * @package: 算法语言基础.Day11_9
 * @className: test1_7
 * @author: IT_Jay
 * @description: TODO
 * @date: 2021/11/10 12:03
 */
public class test1_7 {
    public static void main(String[] args) {
        int[][] gr =new int[5][5];
        for (int i=1; i<6; i++){
            for (int j=1; j<=i; j++){
                if (j>1)
                    gr[i-1][j-1] = gr[i-2][j-1] + gr[i-2][j-2];
                else
                    gr[i-1][j-1] = 1;
            }
        }
        for (int i=0; i<5; i++){
            for (int j=5; j>i; j--){
                System.out.print(" ");
            }
            for (int j=0; j<=i; j++){
                System.out.print(gr[i][j]+" ");
            }
            System.out.println();
        }
    }
}
